$(function() {
	var arr=[];
	$.ajax({
		type: "get",
		url: "json/admin.json",
		dataType: 'json',
		success: function(data) {
			console.info(data)
			var html = '';
			var html2 = '';
			var html3 = '';
			var index = 0;
			var index1 = 0;
			$.each(data, function(idx, obj) {
				if(obj.type == '1') {
					console.info(obj.functionName)					    				
					html +=
						'' + obj['functionName'] + '';
					$('#user-Character-'+index1).after(html);
					var index2 = 0;
					$.each(data, function(idx2, obj2) {
						if(obj2.type == '2' && obj2.parentFunctionCode == obj.functionCode) {
							arr.push(obj2.functionName);
						    console.info(arr);
							$('#user-Character-0-'+index2).after(arr[index]);
							index++;
							var index3 = 0;
							$.each(data, function(idx3, obj3) {
								if(6 == arr.length){
									index2++;
									return false;
								}
								
								    arr.push(obj3.functionName);
						            console.info(arr);
						             $('#user-Character-'+index1+'-'+index2+'-'+index3).after(arr[2,index3+1]);
						             index3++;
						             index++;
								}
							)

						};
					});
					
					index1++;
			}
			});

		}
	});

})

